﻿@using ALinq.BBS.App_GlobalResources
@{
    PageData["Title"] = Label.RegisterSuccess;
    Layout = "_LayoutBase.cshtml";
    bool? validated = null;
    if(Model is bool)
    {
        validated = (bool)Model;
    }
    //if (Model.email != null && Model.code != null)
    //{
    //    MembershipUser user = Membership.GetUserNameByEmail(Model.email);
    //    if (user != null)
    //    {
    //        var code = ALinq.BBS.Controllers.HomeController.GetCode(user.CreationDate);
    //        if (code == Model.code)
    //        {
    //            validated = true;
    //        }
    //    }
    //    validated = false;
    //}
}
<style type="text/css">
    #header
    {
        width: 800px;
    }
    #footer
    {
        width: 800px;
    }
</style>
<table style="width: 800px">
    @if (validated == null)
    {
        <tr>
            <td width="200" align="center">
                <img id="imgEmail" src="@Url.Content("~/Content/Images/active.gif")" />
            </td>
            <td align="left" valign="top">
                <div style="font-weight: bold; margin-top: 20px;">
                    注册成功</div>
                <div style="margin-top: 4px; line-height: 22px;">
                    验证邮件已经发到 <span style="font-weight: bold">@Model.Email</span>，请注意查收。</div>
                <div style="margin-top: 20px;">
                    你需要通过该邮件，激活你的帐号，在激活后便可正常使用。</div>
                <div style="margin-top: 4px; line-height: 22px;">
                </div>
                <div>
                </div>
            </td>
        </tr>
    }
    else if (validated.Value)
    {
        <tr>
            <td width="200" align="center">
                <img id="imgEmailSuccess" src="@Url.Content("~/Content/Images/Success.gif")" />
            </td>
            <td align="left" valign="top">
                <div>
                    你的帐号已经成功激活。
                </div>
            </td>
        </tr>
    }
    else
    {
        <tr>
            <td width="200" align="center">
                <img id="imgEmailFail" src="@Url.Content("~/Content/Images/Fail.gif")" />
            </td>
            <td align="left" valign="top">
                <div>
                    帐号激活失败。
                </div>
            </td>
        </tr>
    }
</table>
